﻿using System.Web;
using System.Web.SessionState;

namespace QG.FrontDesk.com.Models
{
    /// <summary>
    /// 会话
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class DataContext<T> where T :class
    {
        private const string str = "key";      //随便取名
        public HttpSessionState httpsessionstate = HttpContext.Current.Session;
        public static DataContext<T> context = new DataContext<T>();      //静态  new 自己
        public T model           //实体层类
        {
            get
            {
                return this.httpsessionstate[str] as T;
            }
            set
            {
                this.httpsessionstate[str] = value;
            }
        }
    }
}